package entity

import (
	"shqsoft.cn/pasnj/base"

	"github.com/jinzhu/gorm"
)

//COMP_JGH 托管中收导入
type COMP_JGH struct {
	ID     int    `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	NY     int    `gorm:"column:NY"`
	CUID   int    `gorm:"column:CUID"`
	KHMC   string `gorm:"column:KHMC"`
	ISCZH  string `gorm:"column:ISCZH"`
	ISJGTT string `gorm:"column:ISJGTT"`
	KJ     string `gorm:"column:KJ"`
	DRJG   string `gorm:"column:DRJG"`
}

//TableName 经营单位中收导入表
func (COMP_JGH) TableName() string {
	return "T_COMP_JGH_DTIP"
}

//COMP_JGHAfterImport 导入后执行
func COMP_JGHAfterImport(tx *gorm.DB, params map[string]string) (err error) {
	prams := make([]interface{}, 1)
	prams[0] = params["NY"]
	tx.Exec("EXEC UP_COMP_JGH_DTIP ?", prams...)
	return nil
}

//COMP_JGHEF 返回结构体
func COMP_JGHEF() base.EntityFunc {
	return func() interface{} {
		entity := COMP_JGH{}
		return &entity
	}
}

//COMP_JGHESF 返回结构体数组
func COMP_JGHESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []COMP_JGH
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("COMP_JGH", base.NewDefaultDao(COMP_JGHEF(), COMP_JGHESF(), nil))
	base.SetAfterCallBack("COMP_JGH", COMP_JGHAfterImport)
}
